<template>
  <div class="bigGiftWrapper">
    <div class="bgShadow"></div>
    <img class="giftBg" src="http://static.52letsgo.cn/zz/wechatimg/bg_gift.png" alt="">
    <img class="giftClose" src="http://static.52letsgo.cn/zz/wechatimg/ic_gift_close.png" alt=""  @click="bgClick">
    <img @click="goCouponList" class="showBtn" src="http://static.52letsgo.cn/zz/wechatimg/btn_gift.png" alt="">
    <div class="list">
      <scroller height="100%" lock-x :bounce="false">
        <div class="content">
          <div class="top">
            <img src="http://static.52letsgo.cn/zz/wechatimg/bg_gift_up.png" alt="">
          </div>
          <div class="item" v-for="item in gifts">
            <img src="http://static.52letsgo.cn/zz/wechatimg/bg_gift_coupon.png" alt="">
            <div class="left">
              ￥<span>3</span>
            </div>
            <div class="right">
              <ul>
                <li>满{{item.conditions}}元可用</li>
                <li>限尾号{{item.lastMobile}}的手机使用</li>
                <li>有效期{{item.deadTime}}</li>
              </ul>
            </div>
          </div>
          <div class="bottom">
            <img src="http://static.52letsgo.cn/zz/wechatimg/bg_gift_down.png" alt="">
          </div>
        </div>
      </scroller>
    </div>
  </div>
</template>
<script>
  import { Scroller } from './../../../components'
  import { showBigGift } from './../../../vuex/getters.js'
  import { set_showBigGift, set_bigGift } from './../../../vuex/actions.js'
  var LocalStorageUtil = require('./../../../commons/js/LocalStorageUtil.js')
  export default {
    data () {
      return {
      }
    },
    props: {
      gifts: {
        type: Array,
        default () {
          return []
        }
      }
    },
    components: {
      Scroller
    },
    vuex: {
      getters: {
        showBigGift
      },
      actions: {
        set_showBigGift,
        set_bigGift
      }
    },
    methods: {
      bgClick () {
        console.log("hha")
        this.set_showBigGift(0)
        this.set_bigGift([])
      },
      goCouponList () {
        this.set_showBigGift(0)
        this.set_bigGift([])
        this.$router.go({path: '/couponList'})
      }
    }
  }
</script>
<style lang="less">
@import './bigGift.less';
</style>